package stark.app.function.screenshot;

import com.bumptech.glide.Glide;
import com.stark.screenshot.ScreenShotEntry;

import stark.app.R;
import stark.app.databinding.ActivityScreenshotDemoBinding;
import stark.common.basic.base.BaseNoModelActivity;

/**
 * Author：daizhongbin on 2021/6/2
 * Email：1027154338@qq.com
 * Desc:
 */
public class ScreenShotDemoActivity extends BaseNoModelActivity<ActivityScreenshotDemoBinding> {

    @Override
    protected int onCreate() {
        return R.layout.activity_screenshot_demo;
    }

    @Override
    protected void initView() {
        mDataBinding.btnStartDef.setOnClickListener(v -> {
            ScreenShotEntry.start();
        });
        mDataBinding.btnCallback.setOnClickListener(v -> {
            ScreenShotEntry.start(null, new ScreenShotEntry.RetCallback() {
                @Override
                public void onResult(String imgPath) {
                    Glide.with(ScreenShotDemoActivity.this).load(imgPath).into(mDataBinding.ivImg);
                }
            });
        });
        mDataBinding.btnEnterSrec.setOnClickListener(v -> {
            startActivity(ScreenRecDemoActivity.class);
        });
    }

    @Override
    protected void initData() {
    }
}
